package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayApplyTrade;
import com.yuyou.activity.comm.service.mapper.PayApplyTradeMapper;
import com.yuyou.activity.comm.service.service.IPayApplyTradeService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;


@Service
public class PayApplyTradeServiceImpl implements IPayApplyTradeService{

	@Autowired
	private PayApplyTradeMapper payApplyTradeMapper;
	
	@Override
	public int deleteByPrimaryKey(Long payApplyTradeId) {
		return payApplyTradeMapper.deleteByPrimaryKey(payApplyTradeId);
	}

	@Override
	public int insert(PayApplyTrade record) {
		record.setPayApplyTradeId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());		
		return payApplyTradeMapper.insert(record);
	}

	@Override
	public PayApplyTrade selectByPrimaryKey(Long payApplyTradeId) {
		return payApplyTradeMapper.selectByPrimaryKey(payApplyTradeId);
	}

	@Override
	public int updateByPrimaryKeySelective(PayApplyTrade record) {
		return payApplyTradeMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public ResBoolSimpleInfo<String> add(PayApplyTrade record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}
	
	
	
}